package com.wdemo.controller;

import com.wdemo.pojo.vo.SessionVO;
import com.wdemo.service.ChatSessionService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

/**
 * @ClassName SessionController
 * @Description TODO
 * @Author WDEMO
 * @Date 2025/8/29 18:04
 */
@Slf4j
@CrossOrigin
@RequestMapping("/session")
@RestController
@RequiredArgsConstructor
public class SessionController {

    private final ChatSessionService chatSessionService;

    /**
     * 新建会话
     */
    @PostMapping
    public SessionVO createSession(@RequestParam(value = "type") String type) {
        return this.chatSessionService.createSession(type);
    }

//
//    private final AliyunOSSOperator aliyunOSSOperator;
//
//    @GetMapping("/download/{objectName}")
//    public void downloadFile(
//            @PathVariable String objectName,
//            HttpServletResponse response) throws Exception {
//
//        // 解码URL编码的objectName（如果需要）
//        String decodedObjectName = URLDecoder.decode(objectName, StandardCharsets.UTF_8.toString());
//
//        aliyunOSSOperator.downloadToBrowser(decodedObjectName, response);
//    }
}
